package com.qingke.model;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.tomcat.jni.Socket;

@WebServlet("/login")
public class LoginServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
    private static final String ip = "192.168.4.59";
    private static final int port = 3306;
    
    public LoginServlet() {
        super();
    }
    @Override
    public void init() throws ServletException {
    	super.init();
    	Socket s = new Socket();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset="+"utf-8");
		String name = request.getParameter("username");
		request.getSession().setAttribute("name",name);
		response.sendRedirect("use.jsp");
		
		
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
